package com.wmb.userservice;

import io.seata.common.ConfigurationKeys;
import io.seata.config.ConfigurationFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

@EnableFeignClients//启用openfeign
@SpringBootApplication
public class UserServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserServiceApplication.class, args);
        checkSeataConfig();
    }

//    配置检查
    private static void checkSeataConfig() {
        String appId = ConfigurationFactory.getInstance().getConfig(ConfigurationKeys.APPLICATION_ID);
        String txGroup = ConfigurationFactory.getInstance().getConfig(ConfigurationKeys.TX_SERVICE_GROUP);
        System.out.println("Seata Config - applicationId: " + appId);
        System.out.println("Seata Config - txServiceGroup: " + txGroup);
    }
}
